# a = {'Body': '{"currentpage":1,'
#              '"pagesize":20,'
#              '"bodylist":''['
#                  '{"TRANSACTION_ID":"100001226568","YSXKZH":"20190052","XMMC":"2009JG04-2水晶湖郡B区三期(3-6号楼,3-5号楼)","XMDZ":"集美区杏林湾片区滨水东岸，湾东路西南侧，沈海高速公路接引线西侧","XMDQ":"集美区","PZZZTS":154,"KSZZTS":152,"APPROVALDATE":"2019-08-05T11:26:06","OLDFLAG":0,"PZMJ":42484.39,"KSMJ":41932.07,"KSZZMJ":41932.07,"PZZZMJ":42484.39,"PZTS":154,"KSTS":152,"GETDATE":"2019-08-05T11:26:06","RN":1.0},'
#                  '{"TRANSACTION_ID":"100001216958","YSXKZH":"20190051","XMMC":"J2018P01国贸天峯(5号楼,3号楼,1号楼,地下室,2号楼,6号楼)","XMDZ":"福建省厦门市集美区集美区11-11片区杏林北二路与杏锦路交叉口西北侧","XMDQ":"集美区","PZZZTS":660,"KSZZTS":556,"APPROVALDATE":"2019-07-26T18:11:03","OLDFLAG":0,"PZMJ":99928.13,"KSMJ":86137.26,"KSZZMJ":60518.42,"PZZZMJ":71708.88,"PZTS":1471,"KSTS":1289,"GETDATE":"2019-07-26T18:11:03","RN":2.0},'
#                  '{"TRANSACTION_ID":"100001215556","YSXKZH":"20190050","XMMC":"2017TP01融信·厦门世纪(5号楼,S1号楼、S2号楼,2号楼)","XMDZ":"福建省厦门市同安区同安新城12-14西柯片区通福路与滨海旅游交叉口西北侧（A地块）","XMDQ":"同安区","PZZZTS":120,"KSZZTS":120,"APPROVALDATE":"2019-07-25T17:33:49","OLDFLAG":0,"PZMJ":13705.27,"KSMJ":13705.27,"KSZZMJ":12468.24,"PZZZMJ":12468.24,"PZTS":129,"KSTS":129,"GETDATE":"2019-07-25T17:33:49","RN":3.0},'
#                  '{"TRANSACTION_ID":"100001215234","YSXKZH":"20190049","XMMC":"2018P03中骏天宸(10号楼,8号、9号楼,11号、12号楼,地下室)","XMDZ":"福建省厦门市湖里区06-07枋湖片区枋湖北二路与枋湖中路交叉口西南侧（A3地块）","XMDQ":"湖里区","PZZZTS":229,"KSZZTS":151,"APPROVALDATE":"2019-07-25T16:39:45","OLDFLAG":0,"PZMJ":73602.61,"KSMJ":55288.56,"KSZZMJ":28275.52,"PZZZMJ":43392.01,"PZTS":1102,"KSTS":931,"GETDATE":"2019-07-25T16:39:45","RN":4.0},'
#                  '{"TRANSACTION_ID":"100001215123","YSXKZH":"20190048","XMMC":"2010TP04(B1-13)地块莱昂公馆二期(8号楼,2号楼,6号楼,15号楼,5号楼,3号楼,地下室,11号楼,4号楼,7号楼,10号楼,1号楼)","XMDZ":"福建省厦门市翔安区滨海新城13-04片区滨海东大道西侧","XMDQ":"翔安区","PZZZTS":204,"KSZZTS":200,"APPROVALDATE":"2019-07-25T16:38:55","OLDFLAG":0,"PZMJ":50766.5,"KSMJ":50391.79,"KSZZMJ":21230.23,"PZZZMJ":21604.94,"PZTS":902,"KSTS":898,"GETDATE":"2019-07-25T16:38:55","RN":5.0},'
#                  '{"TRANSACTION_ID":"100001214882","YSXKZH":"20190047","XMMC":"2018P02地块建发·玺樾B1子地块、幼儿园（B3子地块）","XMDZ":"福建省厦门市湖里区06-07枋湖片区成功大道与金山西路交叉口东北侧","XMDQ":"湖里区","PZZZTS":438,"KSZZTS":216,"APPROVALDATE":"2019-07-25T10:56:00","OLDFLAG":0,"PZMJ":91412.71,"KSMJ":49916.72,"KSZZMJ":30558.72,"PZZZMJ":62804.99,"PZTS":1284,"KSTS":794,"GETDATE":"2019-07-25T10:56:00","RN":6.0},'
#                  '{"TRANSACTION_ID":"100001201859","YSXKZH":"20190046","XMMC":"2016XP05IOI棕榈国际住区(1号楼,地下室,2号楼)","XMDZ":"翔安区13-15翔安新城片区新城中路与翔安西路交叉东北侧B地块","XMDQ":"翔安区","PZZZTS":36,"KSZZTS":35,"APPROVALDATE":"2019-07-16T17:45:44","OLDFLAG":0,"PZMJ":8273.86,"KSMJ":8118.23,"KSZZMJ":4519.9,"PZZZMJ":4636.69,"PZTS":99,"KSTS":97,"GETDATE":"2019-07-16T17:45:44","RN":7.0},'
#                  '{"TRANSACTION_ID":"100001201854","YSXKZH":"20190045","XMMC":"T2018P02厦门紫云府","XMDZ":"同安区12-06城北区同安大道与美洋路交叉口东南侧、同安大道与朝元路交叉口西南侧","XMDQ":"同安区","PZZZTS":460,"KSZZTS":454,"APPROVALDATE":"2019-07-16T11:15:08","OLDFLAG":0,"PZMJ":63722.31,"KSMJ":63192.0,"KSZZMJ":47009.03,"PZZZMJ":47539.34,"PZTS":912,"KSTS":906,"GETDATE":"2019-07-16T11:15:08","RN":8.0},'
#                  '{"TRANSACTION_ID":"100001200139","YSXKZH":"20190044","XMMC":"2010TP01特房樾琴湾(联合地下室,3号楼,1号楼,8号楼,5号楼,4号楼)","XMDZ":"同安区滨海新城13-04片区民安大道以南","XMDQ":"同安区","PZZZTS":978,"KSZZTS":739,"APPROVALDATE":"2019-07-16T11:13:33","OLDFLAG":0,"PZMJ":121734.56,"KSMJ":99946.41,"KSZZMJ":66804.87,"PZZZMJ":88593.02,"PZTS":1904,"KSTS":1665,"GETDATE":"2019-07-16T11:13:33","RN":9.0},'
#                  '{"TRANSACTION_ID":"100001169411","YSXKZH":"20190043","XMMC":"X2018P03地块前海湾(1-10号楼,地下室)","XMDZ":"翔安区13-16片区滨海东大道与新城中路交叉口西南侧A地块","XMDQ":"翔安区","PZZZTS":670,"KSZZTS":633,"APPROVALDATE":"2019-06-28T09:04:15","OLDFLAG":0,"PZMJ":104648.8,"KSMJ":101062.23,"KSZZMJ":72710.64,"PZZZMJ":76297.21,"PZTS":1494,"KSTS":1457,"GETDATE":"2019-06-28T09:04:15","RN":10.0},'
#                  '{"TRANSACTION_ID":"100001169427","YSXKZH":"20190042","XMMC":"2016XP04融侨·铂樾府(6号楼)","XMDZ":"翔安区13-15翔安新城片区新城中路与翔安西路交叉口东北侧A地块","XMDQ":"翔安区","PZZZTS":134,"KSZZTS":118,"APPROVALDATE":"2019-06-27T19:44:35","OLDFLAG":0,"PZMJ":12003.42,"KSMJ":10593.25,"KSZZMJ":10593.25,"PZZZMJ":12003.42,"PZTS":134,"KSTS":118,"GETDATE":"2019-06-27T19:44:35","RN":11.0},'
#                  '{"TRANSACTION_ID":"100001215095","YSXKZH":"20190041","XMMC":"2017TP01融信厦门世纪(1号楼,3号楼,地下室)","XMDZ":"福建省厦门市同安区同安新城12-14西柯片区通福路与滨海旅游交叉口西北侧（A地块）","XMDQ":"同安区","PZZZTS":96,"KSZZTS":96,"APPROVALDATE":"2019-07-25T10:57:55","OLDFLAG":0,"PZMJ":24945.63,"KSMJ":24945.63,"KSZZMJ":10220.51,"PZZZMJ":10220.51,"PZTS":544,"KSTS":544,"GETDATE":"2019-06-27T19:13:43","RN":12.0},'
#                  '{"TRANSACTION_ID":"100001154813","YSXKZH":"20190040","XMMC":"J2016P01禹洲·璟阅城(1号楼,5号楼,11号楼，13号楼,地下室)","XMDZ":"集美区11-03片区安仁大道与学府路交叉口北侧（东部新区12号地块）","XMDQ":"集美区","PZZZTS":227,"KSZZTS":200,"APPROVALDATE":"2019-06-19T16:09:25","OLDFLAG":0,"PZMJ":56733.87,"KSMJ":54354.58,"KSZZMJ":18417.73,"PZZZMJ":20797.02,"PZTS":1248,"KSTS":1221,"GETDATE":"2019-06-19T16:09:25","RN":13.0},'
#                  '{"TRANSACTION_ID":"100001148697","YSXKZH":"20190039","XMMC":"2015TG02厦门现代服务业基地（丙洲片区）统建区I-7地块(5号楼)","XMDZ":"同安区同安新城12-14片区西洲路北侧厦门现代服务业基地（丙洲片区）统建区","XMDQ":"同安区","PZZZTS":0,"KSZZTS":0,"APPROVALDATE":"2019-06-18T15:14:58","OLDFLAG":0,"PZMJ":8644.73,"KSMJ":8644.73,"KSZZMJ":0.0,"PZZZMJ":0.0,"PZTS":15,"KSTS":15,"GETDATE":"2019-06-18T15:14:58","RN":14.0},'
#                  '{"TRANSACTION_ID":"100001152339","YSXKZH":"20190038","XMMC":"2017XP03国贸天成","XMDZ":"翔安区13-15片区石厝路（在建）与浦后路（规划）交叉口西北侧（B18）","XMDQ":"翔安区","PZZZTS":503,"KSZZTS":268,"APPROVALDATE":"2019-06-17T18:55:08","OLDFLAG":0,"PZMJ":73191.49,"KSMJ":44585.82,"KSZZMJ":29471.99,"PZZZMJ":51062.15,"PZTS":1114,"KSTS":681,"GETDATE":"2019-06-17T18:55:08","RN":15.0},'
#                  '{"TRANSACTION_ID":"100001135200","YSXKZH":"20190037","XMMC":"2016TP02保利叁仟栋三期（地块一）(1-3号楼,1-1A号楼,1-2A号楼,1-3A号楼,1-5A号楼,1-8A号楼)","XMDZ":"同安区同安新城12-15片区滨海西大道东侧官浔溪南侧","XMDQ":"同安区","PZZZTS":256,"KSZZTS":237,"APPROVALDATE":"2019-06-05T17:13:46","OLDFLAG":0,"PZMJ":27611.83,"KSMJ":25867.35,"KSZZMJ":23027.69,"PZZZMJ":24772.17,"PZTS":306,"KSTS":287,"GETDATE":"2019-06-05T17:13:46","RN":16.0},'
#                  '{"TRANSACTION_ID":"100001132725","YSXKZH":"20190036","XMMC":"X2017P05万科·雅居乐金域缇香","XMDZ":"翔安区13-06下潭南片区翔安大道与亭洋路交叉口西北侧（B-09）","XMDQ":"翔安区","PZZZTS":222,"KSZZTS":215,"APPROVALDATE":"2019-06-04T17:22:52","OLDFLAG":0,"PZMJ":27940.48,"KSMJ":27440.11,"KSZZMJ":18021.53,"PZZZMJ":18521.9,"PZTS":479,"KSTS":472,"GETDATE":"2019-06-04T17:22:52","RN":17.0},'
#                  '{"TRANSACTION_ID":"100001136124","YSXKZH":"20190035","XMMC":"2018HP02马銮湾1号","XMDZ":"海沧区05-08新阳东片区新垵北路与乐活路交叉口西北侧A2","XMDQ":"海沧区","PZZZTS":844,"KSZZTS":786,"APPROVALDATE":"2019-06-04T16:58:31","OLDFLAG":0,"PZMJ":126773.6,"KSMJ":120658.16,"KSZZMJ":89295.04,"PZZZMJ":95089.06,"PZTS":1894,"KSTS":1825,"GETDATE":"2019-06-04T16:58:31","RN":18.0},'
#                  '{"TRANSACTION_ID":"100001131571","YSXKZH":"20190034","XMMC":"2018HP01中央公园(1号楼,2号楼,6号楼,7号楼,8号楼,S4号楼,S5号楼,地下室)","XMDZ":"海沧区05-08新阳东片区新垵北路与乐活路交叉口西北侧（A1地块）","XMDQ":"海沧区","PZZZTS":589,"KSZZTS":491,"APPROVALDATE":"2019-06-03T19:44:05","OLDFLAG":0,"PZMJ":98693.05,"KSMJ":89218.87,"KSZZMJ":51449.55,"PZZZMJ":60040.99,"PZTS":1867,"KSTS":1740,"GETDATE":"2019-06-03T19:44:05","RN":19.0},'
#                  '{"TRANSACTION_ID":"100001130320","YSXKZH":"20190033","XMMC":"2012JP01地块D4、D5子地块IOI棕榈城(B7号楼,B9号楼,B10号楼)","XMDZ":"集美区11-12片区集美新城片区杏林湾路与集美大道交叉口南侧“2012JP01地块”","XMDQ":"集美区","PZZZTS":24,"KSZZTS":10,"APPROVALDATE":"2019-06-03T18:08:12","OLDFLAG":0,"PZMJ":5164.73,"KSMJ":2106.44,"KSZZMJ":2106.44,"PZZZMJ":5164.73,"PZTS":24,"KSTS":10,"GETDATE":"2019-06-03T18:08:12","RN":20.0}'
#                  '],'
#              '"recordcount":1046'
#              '}',
#      'result': 1}


# def utc_to_local(utc_time_str, utc_format='%Y-%m-%dT%H:%M:%S'):
#     local_tz = pytz.timezone('Asia/Chongqing')
#     local_format = "%Y-%m-%d %H:%M:%S"
#     utc_dt = datetime.datetime.strptime(utc_time_str, utc_format)
#     local_dt = utc_dt.replace(tzinfo=pytz.utc).astimezone(local_tz)
#     # print(local_dt)
#     time_str = local_dt.strftime(local_format)
#     return time_str


# import pytz
# import datetime
# item_eg = {'TRANSACTION_ID': '100001226568',
#            # 'YSXKZH': '20190052',
#            # 'XMMC': '2009JG04-2水晶湖郡B区三期(3-6号楼,3-5号楼)',
#            # 'XMDZ': '集美区杏林湾片区滨水东岸，湾东路西南侧，沈海高速公路接引线西侧',
#            # 'XMDQ': '集美区',
#            # 'PZZZTS': 154,
#            # 'KSZZTS': 152,
#            'APPROVALDATE': '2019-08-05T11:26:06',
#            'OLDFLAG': 0,
#            # 'PZMJ': 42484.39,
#            # 'KSMJ': 41932.07,
#            # 'KSZZMJ': 41932.07,
#            # 'PZZZMJ': 42484.39,
#            # 'PZTS': 154,
#            # 'KSTS': 152,
#            'GETDATE': '2019-08-05T11:26:06',
#            'RN': 1.0
#            }


import time

b = round(time.time() * 1000)

# a = 'javascript:DispLp(6000037891,1000023507,115982)'
# b = a.split('(')[1].split(')')[0].split(',')

# a = 'fw_bksfw  hand'
a = 'cellSepClass'

c = dict(
    a=1,
    b=2,
    c='asd'
)

# from FDC_spider.items import FdcEstateGuidItem
#
# item = FdcEstateGuidItem()
# item['projectId'] = 1

import re

# f_str = '建筑面积:14988.4500m'
f_str = '地上:14988层         '

import logging

logger = logging.getLogger(__name__)

try:
    a = 5
    b = a / 0
except Exception as e:
    logger.error('总楼层失败：{}'.format(e))
else:
    print(b)

a = '拟售参考均价(由开发企业提供):商业：44511.91元/平 商务办公：42329.00元/平 戊类库房：27500.00元/平  '

if __name__ == '__main__':
    # print(utc_to_local('2019-08-05T11:26:06'))
    # print(type(b))
    # if a.startswith('fw_bksfw'):
    #     print(1)
    # print([_ for _ in item.keys()])
    # print(item.get('id',None))
    # print(re.findall(r'地上:(.*)层', f_str)[0])

    # a = re.sub(r'\uff1a',':',a).split(':',maxsplit=1)[1]
    # a= re.sub(r'\s+','_',a).split('_')
    # a={i.split(':')[0]:i.split(':')[1] for i in a if i.strip()!=''}
    # print(a)

    # a='       ' \
    #   '                   ' \
    #   '                               平方米'
    # a=re.sub(r'\s+','',a)
    # print('*',a,'*')
    # a= re.findall(r'(.*)平',a)
    # print('*',a,'*')
    # a= a[0] if len(a)>0 else None
    # print('*',a,'*')

    # price_str = '拟售参考均价(由开发企业提供):住宅：50000.42元/平 戊类库房：14639.01元/平  '
    price_str = '拟售参考均价(由开发企业提供):商业：60000.00元/平&nbsp&nbsp;'
    # price_str = '拟售参考均价(由开发企业提供):住宅：50000.42元/平&nbsp戊类库房：14639.01元/平&nbsp&nbsp;'
    price_str = re.sub(r'\uff1a', ':', price_str).split(':', maxsplit=1)[1]
    price_str = price_str.strip() if price_str else None
    price_li = re.sub(r'\s+|&nbsp|;', '_', price_str)
    price_li = re.sub(r'_{1,}', '_', price_li).split('_')
    # price_li = re.sub(r'\s+|&nbsp|&nbsp;', '_', price_str).split('_')
    # print(price_li)
    priceDict = {i.split(':')[0]: i.split(':')[1] for i in price_li if i.strip() != ''}

    # print(priceDict)
    import datetime

    today = datetime.datetime.now()
    # print(today.hour,today.minute,today.second)

    # file_temp = './csv_file/{}_{}_{}_{}_{}_{}_{}_{}.csv'
    # f = open(file_temp.format('beijing', 'estate', today.year, today.month, today.day, today.hour,today.minute, today.second), 'w',encoding='utf-8', newline='')
    # f.close()

    # a = 'width:130px;background:#33CC00;float:left;border: 1px solid white;margin: 1px 1px 0 0;'
    # a = re.findall(r'background:(.*);',a)[0].split(';')[0]
    # a = a.split(';')
    a = '通州区梨园镇小街村东通州区梨园镇小街村东'
    a = a.split('区')[0] + '区'
    # print(a)
    a = {'CA': '佛山市住房和城乡建设管理局',
         'avgPrice': '价格待定',
         'certDate': '2019-08-21',
         'certExpiryDate': '2021-02-28',
         'certStartDate': '2019-08-20',
         'commerceArea': 0,
         'commerceNum': 0,
         'createTime': '2019-08-21 18:14:29',
         'developerName': '佛山乡村房地产开发有限公司',
         'districtName': '南海区 ',
         'estateAddress': '佛山市南海区狮山镇高尔夫路333号广佛新世界庄园20区',
         'estateTotalArea': '136353㎡',
         'estateUrl': 'http://fsfc.fsjw.gov.cn/hpms_project/roomView.jhtml?id=279940',
         'fetchTime': '2019-08-21 18:14:29',
         'floorAreaRatio': '0.76',
         'otherArea': 0,
         'otherNum': 0,
         'preSaleAccountNum': None,
         'preSaleArea': 5690.48,
         'preSaleBlockName': '广佛新世界庄园20区63栋,广佛新世界庄园20区59栋,广佛新世界庄园20区62栋,广佛新世界庄园20区61栋',
         'preSaleDepositBank': None,
         'preSalePermit': '南房现字第2019040402号',
         'preSaleRoomNo': 14,
         'projectId': '279940',
         'projectName': ' 广佛新世界庄园凯璟湾',
         'propertyCompany': '广州锦日物业服务有限公司佛山分公司',
         'propertyManagementFee': None,
         'qualificationCertificateNo': '粤佛房开证字第1302239号 ',
         'qualificationGrade': '四级 ',
         'residenceArea': 5690.48,
         'residenceNum': 14,
         'salesTel': '0757-81778888',
         'soldTotalRoomNo': '150',
         'unsoldTotalRoomNo': '116',
         'updateTime': '2019-08-21 18:14:29'}
    b = {'blockName': '6座商铺',
         'city': '佛山市',
         'createTime': '2019-08-21 18:56:54',
         'developerName': '佛山市高明区联丰置业发展有限公司',
         'districtName': '高明区 ',
         'fetchTime': '2019-08-21 18:56:54',
         'forecastBuildArea': '93.14',
         'forecastInnerArea': '93.14',
         'isMortgage': '否',
         'isSealedOff': '否',
         'preSalePermit': '高房现字第2016015804号',
         'projectName': ' 天汇湾',
         'realBuildArea': '93.14',
         'realInnerArea': '93.14',
         'roomLocation': '佛山市高明区荷城街道怡乐路888号6座架空层1',
         'roomNature': None,
         'roomNo': '6座架空层1',
         'roomStructure': None,
         'roomTotalPrice': None,
         'roomUse': '架空层',
         'saleStatus': '自用',
         'siteName': '佛山市房产信息网',
         'sr': 'fsfc',
         'stateOfOwnership': '自用',
         'unitName': None,
         'updateTime': '2019-08-21 18:56:54'}
    print(b.keys())
